package com.alibaba.algo.domain.user;

import com.alibaba.algo.core.base.BaseDomain;
import com.alibaba.algo.dao.user.SysLabelOrgEmployeeMapper;
import com.alibaba.algo.entity.user.SysLabelOrgEmployee;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 岗位标签员工
 *
 * @author Songtinghua
 * @create 2021-10-29 12:43
 **/
@Component
public class SysLabelOrgEmployeeDomain extends BaseDomain<SysLabelOrgEmployee> {

    @Autowired
    SysLabelOrgEmployeeMapper sysLabelOrgEmployeeMapper;

    /**
     * 根据标签查询相关联的组织和员工信息
     *
     * @param sysLabelOrgId SysLabel id
     * @return list
     */
    public List<SysLabelOrgEmployee> selectBySysLabelOrgId(Long sysLabelOrgId) {
        return sysLabelOrgEmployeeMapper.selectBySysLabelOrgId(sysLabelOrgId);
    }

    /**
     * 删除对于标签下的信息
     *
     * @param sysLabelOrgId SysLabel id
     * @return int
     */
    public int deleteBySysLabelOrgId(Long sysLabelOrgId) {
        return sysLabelOrgEmployeeMapper.deleteBySysLabelOrgId(sysLabelOrgId);
    }

    /**
     * 删除对于标签下的信息(软删除--数据置为无效)
     *
     * @param sysLabelOrgId SysLabelOrg id
     * @return int
     */
    public int updateBySysLabelOrgId(@Param("sysLabelOrgId") Long sysLabelOrgId) {
        return sysLabelOrgEmployeeMapper.updateBySysLabelOrgId(sysLabelOrgId);
    }

    public int deleteByEmployeeId(Long employeeId) {
        return sysLabelOrgEmployeeMapper.deleteBySysEmployeeId(employeeId);
    }
}
